using Microsoft.Xna.Framework;
using SCSEngine.Services.Sprite;
using SCSEngine.Sprite;
using SCSEngine.Utils.Entities.Component;
using SCSEngine.Utils.Entities.Component.SpriteComponents;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SCSEngine.Utils.Entities.Process.Draw
{
    public class SpriteDrawProcess : DrawableGameComponent
    {
        private SpriteComponent sprite;
        private ISpriteModelComponent spriteModel;

        private SpritePlayer spritePlayer;

        public SpriteDrawProcess(IGameEntity entity, SpritePlayer sprPlayer)
            : base(null)
        {
            this.sprite = entity.GetComponent<SpriteComponent>(ComponentKeys.Sprite);
            this.spriteModel = entity.GetComponent<ISpriteModelComponent>(ComponentKeys.SpriteModel);

            this.spritePlayer = sprPlayer;
        }

        public override void Draw(GameTime gameTime)
        {
            spritePlayer.Draw(this.sprite.Value, this.spriteModel.Value);
            base.Draw(gameTime);
        }

    }
}
